package org.jclosures.function.base;

import org.jclosures.function.Function1;
import org.jclosures.function.Function2;

public abstract class AbstractFunction2<PT1, PT2, RT> implements
		Function2<PT1, PT2, RT> {

	public Function1<PT2, RT> apply(final PT1 arg1) {

		return new Function1<PT2, RT>() {
			public RT apply(final PT2 arg2) {
				return AbstractFunction2.this.apply(arg1, arg2);
			};

			@Override
			public String toString() {
				return "Closure function with bind { arg1 : " + arg1 + "}";
			}
		};
	}
}